package cn.sixmillions.yuqueblog.controller;

import cn.sixmillions.yuqueblog.entity.User;
import cn.sixmillions.yuqueblog.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 语雀用户API
 * @author: sixmillions
 * @since: 2021/12/10
 **/
@RestController
@RequestMapping("/api/user")
@Api(value = "User Controller", tags = "User")
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * 获取单个用户信息
     */
    @GetMapping("/{login}")
    @ApiOperation(value = "User Info", notes = "单个用户信息")
    public User getUserInfo(@PathVariable String login) {
        return userService.getUserInfo(login);
    }
}
